package game.controller;

import common.controller.base.BaseController;
import common.model.response.base.Result;
import game.model.request.LoadOneStepRequest;
import game.service.GProductLineService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 产线规划前端控制器
 *
 * @author 米泽鹏
 * @since 2022-03-02
 */

@Api(tags = "产线规划")
@RestController
@RequestMapping("/game/g-production-line")
public class GProductionLineController extends BaseController {

	@Resource
	private GProductLineService productLineService;

	@ApiOperation(value = "产线规划树状图懒加载", notes = "产线规划树状图懒加载，只加载一步")
	@PostMapping("/readOnly/loadOneStep")
	public Result<?> loadOneStep(@ApiParam(value = "产线规划树状图懒加载请求", required = true) @RequestBody @Validated LoadOneStepRequest request) {
		return successWithData(productLineService.loadOneStep(request));
	}

}
